package game.engine.base

import android.app.Activity
import com.helloandroid.R
import com.helloandroid.base.BaseActivity

abstract class GameActivity : BaseActivity(), IGameApp {

    //--------------------------
    // properties
    lateinit var renderView: RenderView
    lateinit var director: Director

    //--------------------------
    // igameapp
    override val activity: Activity
        get() = this

    override fun getContentViewResId(): Int = R.layout.activity_renderview

    override fun initView() {
        renderView = findViewById(R.id.renderView)
        director = Director(this, renderView)
    }

    override fun initData() {

    }

    override fun onPause() {
        super.onPause()
        director.pause()
    }

    override fun onResume() {
        super.onResume()
        director.resume()
    }

    override fun onDestroy() {
        super.onDestroy()
        director.stopEngine()
    }
}